#!/usr/bin/env node

const http = require('http');
const server = http.createServer();

server.on('request', (req, res) => {
  res.writeHead(200, { 'Content-Type': 'text/plain' });
  res.end('Hello world!');
});

server.listen(8080, () => {
  console.log('Server is running on http://localhost:8080');
});

//与01都是命令行程序
//与01区别给浏览器提供网络服务